home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1623 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.3 KB

  1. Subject: supplementary groups question...
  2. Date: Thu, 23 Jun 94 9:59:34 +0200
  3. From: Torsten Scherer <itschere@techfak.uni-bielefeld.de>
  4.  
  5.  Again: Hi! :-)
  6.  
  7.  I now want to finish what I've partly started some weeks before and what
  8. has already gone into the mh3 meta patch: The story of the supplementary
  9. groups. Now, before I run into problems again because I implement things
  10. the way I would like them and not the way the rest of the world understands
  11. them, I like to ask to be sure first... ;-)
  12.  
  13.  My current understanding is that a process inherits its supplementary
  14. groups from its parent. Apart from that, only the superuser is allowed to
  15. change them, say, `login' should do that together with a library function
  16. `initgroups'. The rest would simply be to fix the denyaccess() function
  17. in filesys.c to respect the supplementary groups. There's explicitly *no*
  18. need for a program to set the egid to any of its suppgids when it wants
  19. to access something. Everything necessary is done in the kernel. Right? :-)
  20.  
  21.  Besides that: The current code of denyaccess() says something like:
  22.  
  23. mode = xattr->mode;
  24. if (curproc->euid == xattr->uid)
  25.     perm = perm << 6;
  26. else if (curproc->egid == xattr->gid)
  27.     perm = perm << 3;
  28. if ((mode & perm) != perm) return 1;    /* access denied */
  29. return 0;
  30.  
  31.  which I think is an error, because if both my euid and egid would match the
  32. ids of the file, but the uid would give me less access rights than the gid
  33. for some mysterious reasons, I'll not be granted access to this file. I think
  34. it should better be something like:
  35.  
  36. mode = xattr->mode;
  37. if (curproc->euid == xattr->uid) {
  38.     if ((mode >> 6) & perm) == perm)
  39.         return 0;
  40. }
  41. if (curproc->guid == xattr->gid) {
  42.     if ((mode >> 3) & perm) == perm)
  43.         return 0;
  44. }
  45. if ((mode & perm) == perm)
  46.     return 0;    /* access denied */
  47. return 1;
  48.  
  49.  One could yet complicate this thing by saying: If the file would look like
  50. r---w---x and all my effective ids match the ones given in the file I should
  51. also given access to it, but I guess no other OS really implements this, does
  52. it? ;-)
  53.  
  54.  Any comments about this? :-)
  55.  
  56. ciao,
  57. TeSche
  58. -- 
  59. Torsten Scherer (TeSche, Schiller...)
  60. Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
  61. | Use any of "finger itschere@129.70.131.2-15" for adresses and more.    |
  62. | Last updated: 14. April 1994.                        |
  63.